//
//  ZH_HomeImgaeTableViewCell.m
//  WisdomStar
//
//  Created by zhangliwen on 2018/10/17.
//  Copyright © 2018年 zhangliwen. All rights reserved.
//

#import "ZH_HomeImgaeTableViewCell.h"
@interface ZH_HomeImgaeTableViewCell()
@property (nonatomic,weak)UIImageView *bgView;
@property (nonatomic,weak)UILabel *titleLabel;
@end
@implementation ZH_HomeImgaeTableViewCell

///创建
+(instancetype)cellWithTableView:(UITableView*)tableView
{
    static NSString *ID = @"ZH_HomeImgaeTableViewCell";
    ZH_HomeImgaeTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if(cell == nil){
        cell = [[ZH_HomeImgaeTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
    }
    return cell;
}
///初始化
-(void)initDefault
{
    [self unShowClickEffect];
}
- (void)loadSubviewConstraints{
    [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(FITSCALE(9));
        make.left.equalTo(self.contentView).offset(FITSCALE(11));
        make.right.equalTo(self.contentView).offset(FITSCALE(-11));
        make.bottom.equalTo(self.contentView).offset(FITSCALE(-9));
    }];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.contentView);
        make.bottom.equalTo(self.bgView.mas_bottom).offset(FITSCALE(-13));
    }];
}

#pragma mark - getter,setter
- (UIImageView *)bgView{
    if (!_bgView) {
        UIImageView *image = [UIImageView createImageViewWithName:@"img_wtc_bg"];
        [self.contentView addSubview:_bgView = image];
    }
    return _bgView;
}
- (UILabel *)titleLabel{
    if (!_titleLabel) {
        UILabel *label = [UILabel createLabelWithText:@"进入问题池" font:kFontSize_26];
        label.textColor = kFontColorWhite;
        [self.contentView addSubview:_titleLabel = label];
    }
    return _titleLabel;
}
@end
